﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Core.DataAccess.Model.iTool.Gateway
{
    public partial class Node
    {
        /// <summary>
        /// 关键字
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int NodeId { get; set; }

        [DisplayName("IP")]
        public string IP { get; set; }

        public string Name { get; set; }


        [DisplayName("CPU")]
        public string CPU { get; set; }

        /// <summary>
        /// 内存
        /// </summary>
        public double MEMUSAGE { get; set; }

        [DisplayName("Memory Usage")]
        public string MEMUSAGEString { get; set; }

        /// <summary>
        /// 所有内存
        /// </summary>
        public double MEMTOTAL { get; set; }

        [DisplayName("Memory Total")]
        public string MEMTOTALString { get; set; }

        /// <summary>
        /// 内存使用率
        /// </summary>
        [DisplayName("Memory")]
        public string MEM { get; set; }

        /// <summary>
        /// 磁盘 I/O 数据
        /// </summary>
        [DisplayName("Disk Usage")]
        public string BLOCKIOUSAGE { get; set; }
        [DisplayName("Disk Total")]
        public string BLOCKIOTOTAL { get; set; }

        [DisplayName("Disk")]
        public string BLOCKIO { get; set; }

        /// <summary>
        /// 0 - 初始化，
        /// 2 - 服务正常，
        /// 4 - 服务暂停
        /// </summary>
        public int Status { get; set; }

        [DisplayName("LastActiveTime")]
        public DateTime? LastActiveTime { get; set; } // 这个应该每2秒提交，每6秒提交服务状态
        public DateTime? CreateTime { get; set; }

        [NotMapped]
        public List<ServiceInstance> ServiceInstances { get; set; }
    }
}
